//
//  XNTimerUIHelper.h
//  xndm_proj
//
//  Created by xn on 2021/5/10.
//  Copyright © 2021 Linfeng Song. All rights reserved.
//

#import <Foundation/Foundation.h>

@class XNTimerUIHelper;

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, XNTimeLabelState){
    XNTimeLabelStateStart = 0,
    XNTimeLabelStateDuration,
    XNTimeLabelStateFinish
};

typedef NSString*__nullable(^TimerLabelProgressBlock)(id ui, XNTimeLabelState state, NSInteger restTime);
typedef void(^ShowTextBlock)(NSString *value);

@interface XNTimerUIHelper : NSObject

@property (nonatomic, assign) NSInteger seconds;

@property (nonatomic, copy) TimerLabelProgressBlock progressBlock;
@property (nonatomic, copy) ShowTextBlock showTextBlock;
@property (nonatomic, assign) NSInteger duration; // default  =1

- (void)startWithSeconds:(NSInteger)seconds;

- (void)cancelTimer;

@end

NS_ASSUME_NONNULL_END
